/**

<body>

<h1>twilio4j</h1>

<p>twilio4j is a<b>Twilio state machine library</b> which allows you to create call flows easily in java. You can
install one servlet and implement your code that reacts to Twilio callback hooks with TwiML, etc.
</p>

<p>Note: In April 2012, I added the com.twilio.sdk sources for the <b>Twilio java client library</b> (from Twilio), which
will allow you to have a Twilio Client on Google AppEngine. Read more about it
<a href="http://code.google.com/p/twilio4j/wiki/OriginalTwilioJavaClientLibrary">here</a>.</p>

<h2>Twilio state machine library</h2>
<p>TwilioStateMachineServlet is the class you need to extend in order to create your own call flow
state machine. First you must create an enumerated type that represents all the states of
your machine. This enum is used to "type" the TwilioStateMachineServlet when you extend it.</p>

<p>You don't override any member functions in your subclass. Instead, you just supply a
constructor, where you repeatedly call handler() to populate your state machine. And
for each hander(), you call respondsWith() and supply straight TwiML statements, or
a code block if you need to supply java code plus TwiML.</p>

<p>Example:</p>
<code>
<pre>
import com.twilio4j.twiml.TwiML;
import com.twilio4j.twism.TwilioParameters;
import com.twilio4j.twism.TwilioStateMachineServlet;

import static com.twilio4j.twism.eg.NumberGameState.*;

public class NumberGameStateMachineServlet extends TwilioStateMachineServlet&lt;NumberGameState&gt; {
	private static final long serialVersionUID = 1L;
	
	public NumberGameStateMachineServlet() {
		handler(PICK_NUMBER).respondsWith(
			gather(
				say("pick a number between zero and nine.")
			)
			.action(CHECK_NUMBER)
			.numDigits(1)
		);
		handler(CHECK_NUMBER).respondsWith(new TwilioHandler() {
			public TwiML getTwiML(TwilioParameters params) {
				char digit = params.Gather().getDigits().charAt(0);
				if ( digit == '5' ) {
					return say("You win! Goodbye.");
				} else if ( digit &lt; '5' ) {
					return gather(
						say("Pick again, higher.")
					)
					.action(CHECK_NUMBER)
					.numDigits(1);
				} else {
					return gather(
						say("Pick again, lower.")
					)
					.action(CHECK_NUMBER)
					.numDigits(1);
				}
			}
		});
	}

	public NumberGameState getInitialState() {
		return PICK_NUMBER;
	}
	public NumberGameState lookupState(String pathInfo) {
		return NumberGameState.valueOf(pathInfo);
	}
	public String getFortyCharacterSecret() {
		return "3440e0fa2eae0a28e5dc58d76793eb151c19acf7";
	}
}
</pre>
</code>

</body>

 */